package myky.com.doctorapp.model;

import io.reactivex.Observable;
import myky.com.doctorapp.api.ApiManager;
import myky.com.doctorapp.base.BaseEntity;
import myky.com.doctorapp.contract.ExperConsultContract;
import myky.com.doctorapp.entity.HealthRecordEntity;
import myky.com.doctorapp.entity.LastConsultEntity;
import myky.com.doctorapp.utils.RequestBodyBuilder;
import okhttp3.RequestBody;

public class ExperConsultModel implements ExperConsultContract.Model {
    @Override
    public Observable<BaseEntity<HealthRecordEntity>> findHealthRecord() {
        return ApiManager.getApistore().findHealthRecord();
    }

    @Override
    public Observable<BaseEntity<LastConsultEntity>> findLastConsultContent(String doctorID, String fillType, String version) {


        RequestBodyBuilder.Builder builder=new RequestBodyBuilder.Builder();
        RequestBody requestBody = builder.params("doctorId", doctorID)
                .params("fillType", fillType)
                .params("version", version)
                .build();


        return ApiManager.getApistore().findLastConslutContent(requestBody);
    }
}
